// 关于进货单的所有接口
import axiosp from '@/apis/axios/indexp.js'
const baseUrl = `/erp`

// 新增付款单
export function addData(params) {
	return axiosp.request({
		url: `${baseUrl}/bill/purchase/addData`,
		method: 'post',
		data: params
	})
}
// 获取单号和日期的接口
export function initAddBill(params) {
	return axiosp.request({
		url: `${baseUrl}/bill/purchase/initAddBill`,
		method: 'post',
		data: params
	})
}

// 获取付款单列表
export function getlist(params) {
	return axiosp.request({
		url: `${baseUrl}/bill/sale/listPage`,
		method: 'post',
		data: params
	})
}

// 获取付款单列表
export function getSaleReturnlist(params) {
	return axiosp.request({
		url: `${baseUrl}/bill/saleReturn/listPage`,
		method: 'post',
		data: params
	})
}


//--------------------------------------------------------
// 作废
export function cancel(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/pay/cancel`,
		method: 'post',
		data: params
	})
}
// 根据ID获取付款单
export function getViewDataByBillId(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/pay/viewDataByBillId`,
		method: 'post',
		data: params
	})
}
// 审核付款单
export function audit(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/pay/audit`,
		method: 'post',
		data: params
	})
}



// 获取customer当前欠款
export function getLastRemainDebtTotal(params) {
	return axiosp.request({
		url: `${baseUrl}/reconciliation/customer/getLastRemainDebtTotal`,
		method: 'post',
		data: params
	})
}
// 获取单据
//comegoId: "1676966881136869376"
export function getListCanWriteOffBillsByCustomerId(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/pay/writeOff/listCanWriteOffBillsBySupplierId`,
		method: 'post',
		data: params
	})
}
// 获取supplier当前欠款
export function getSupplierLastRemainDebtTotal(params) {
	return axiosp.request({
		url: `${baseUrl}/reconciliation/supplier/getLastRemainDebtTotal`,
		method: 'post',
		data: params
	})
}
